﻿
@{
    ViewData["Title"] = "商品编辑";
    Layout = "~/Views/Shared/_Layout.cshtml";
}
@*<link href="/css/Settting.css" rel="stylesheet" />
    <link href="/css/feedback.css" rel="stylesheet" />
    <link href="/Uploader/Uploader6.1.css" rel="stylesheet" />
    <script src="/Uploader/Uploader6.1.js"></script>
    <link href="/css/mui.picker.min.css" rel="stylesheet" />
    <link href="/css/mui.poppicker.css" rel="stylesheet" />

    <script src="/js/GoodsList.js"></script>
    <header class="mui-bar mui-bar-nav">
        <a class="mui-action-back mui-icon mui-icon-left-nav mui-pull-left"></a>
        <h1 class="mui-title">商品编辑</h1>
    </header>
    <div class="mui-content">
        <div class="mui-content-padded" style="margin: 5px;">
            <input type="hidden" id="Id" name="Id" />
            <div class="mui-content-padded">
                <h5>商品名</h5>
                <div class="mui-input-row">
                    <input id="GoodsName" name="GoodsName" type="text" class="mui-input-clear" placeholder="商品名">
                </div>
                <h5>商品分类</h5>
                <select id="ClassId" name="ClassId" class="mui-btn-block">
                    <option value="0">请选择商品分类</option>
                    @foreach (var item in ViewBag.GoodsClass)
                    {

                        @if (item.GdClass.Count > 0)
                        {

                            <optgroup label="@item.ClassName">

                                @foreach (var item2 in item.GdClass)
                                {
                                    <option value="@item2.Id">@item2.ClassName</option>
                                }
                            </optgroup>
                        }
                        else
                        {
                            <option value="@item.Id">@item.ClassName</option>
                        }

                    }
                </select>
                <h5>商品图片</h5>
                <div id='image-list' class="row image-list">
                </div>
                <div class="mui-input-row">
                    <div class="uploader uploader-default" id="uploadThumbnail">
                    </div>
                </div>
                <h5>预览缩略图</h5>
                <div class="mui-input-row">
                    <img id="PreviewThumbnail" src='/images/zanwu.jpg' height="150" width="100%">
                </div>
                <h5>价格</h5>
                <div class="mui-input-row" style="margin: 10px 5px;">
                    <input id="Price" name="Price" type="text" class="mui-input-clear" placeholder="价格">
                </div>
                <h5>是否显示价格</h5>
                <div class="mui-input-row" style="margin: 10px 5px;">
                    <span></span>
                    <div class="mui-switch mui-active">
                        <div class="mui-switch-handle"></div>
                    </div>
                </div>
                <h5>可购买最大数量</h5>
                <div class="mui-input-row" style="margin: 10px 5px;">
                    <input id="PurchaseQuantity" name="PurchaseQuantity" type="text" class="mui-input-clear" placeholder="可购买最大数量">
                </div>
                <h5>可购买最小数量</h5>
                <div class="mui-input-row" style="margin: 10px 5px;">
                    <input type="text" class="mui-input-clear" placeholder="可购买最小数量">
                </div>
                <h5>商品轮播图</h5>
                <div class="mui-input-row" style="margin: 10px 5px;">
                    <div class="file" id="image-1"></div>
                </div>
                <h5>商品介绍图</h5>
                <div class="mui-input-row" style="margin: 10px 5px;">
                    <textarea id="textarea" rows="10" placeholder="商品介绍"></textarea>
                </div>
                <h5>商品介绍</h5>
                <div class="mui-input-row" style="margin: 10px 5px;">
                    <textarea id="Content" name="Content" rows="10" placeholder="商品介绍"></textarea>
                </div>
                <div class="mui-button-row">
                    <button type="button" class="mui-btn mui-btn-primary" onclick="return false;">确认</button>&nbsp;&nbsp;
                    <button type="button" class="mui-btn mui-btn-danger" onclick="return false;">取消</button>
                </div>
            </div>
        </div>
    </div>
    <script src="/js/mui.picker.js"></script>
    <script src="/js/mui.poppicker.js"></script>
    <script src="/js/city.data.js"></script>
    <script src="/js/feedback-page.js"></script>
    <script src="/js/city.data-3.js"></script>
    <script src="~/js/min.NewView.js"></script>
    <script>
        mui.init({
            swipeBack: true //启用右滑关闭功能
        });
        mui('.mui-content .mui-switch').each(function () { //循环所有toggle
            //toggle.classList.contains('mui-active') 可识别该toggle的开关状态
            this.parentNode.querySelector('span').innerText = '状态：' + (this.classList.contains('mui-active') ? 'true' : 'false');
            /**
             * toggle 事件监听
             */
            this.addEventListener('toggle', function (event) {
                //event.detail.isActive 可直接获取当前状态
                this.parentNode.querySelector('span').innerText = '状态：' + (event.detail.isActive ? 'true' : 'false');
            });
        });
    </script>*@
<link href="/css/Settting.css" rel="stylesheet" />
<link href="/css/feedback.css" rel="stylesheet" />

<!--页面主结构开始-->
<div id="app" class="mui-views">
    <div class="mui-view">
        <div class="mui-navbar">
        </div>
        <div class="mui-pages">
        </div>
    </div>
</div>
<!--页面主结构结束-->
@*问题反馈*@
<div id="feedback" class="mui-page feedback">
    <div class="mui-navbar-inner mui-bar mui-bar-nav">
        <button type="button" class="mui-left mui-action-back mui-btn  mui-btn-link mui-btn-nav mui-pull-left">
            <span class="mui-icon mui-icon-left-nav"></span>
        </button>
        <button id="submit" class="mui-btn mui-btn-blue mui-btn-link mui-pull-right">
            发送
        </button>
        <h1 class="mui-center mui-title">商品编辑</h1>
    </div>
   
    <div class="mui-page-content">

        <input type="hidden" id="Id" name="Id" />
        <div class="mui-content-padded">
            <h5>商品名</h5>
            <div class="mui-input-row">
                <input id="GoodsName" name="GoodsName" type="text" class="mui-input-clear" placeholder="商品名">
            </div>
            <h5>商品分类</h5>
            <select id="ClassId" name="ClassId" class="mui-btn-block">
                <option value="0">请选择商品分类</option>
                @foreach (var item in ViewBag.GoodsClass)
                {

                    @if (item.GdClass.Count > 0)
                    {

                        <optgroup label="@item.ClassName">

                            @foreach (var item2 in item.GdClass)
                            {
                                <option value="@item2.Id">@item2.ClassName</option>
                            }
                        </optgroup>
                    }
                    else
                    {
                        <option value="@item.Id">@item.ClassName</option>
                    }

                }
            </select>
            <h5>商品图片</h5>
            <div id='image-list' class="row image-list">
            </div>
            <div class="mui-input-row">
                <div class="uploader uploader-default" id="uploadThumbnail">
                </div>
            </div>
            @*<h5>预览缩略图</h5>
            <div class="mui-input-row">
                <img id="PreviewThumbnail" src='/images/zanwu.jpg' height="150" width="100%">
            </div>*@
            <h5>价格</h5>
            <div class="mui-input-row" style="margin: 10px 5px;">
                <input id="Price" name="Price" type="text" class="mui-input-clear" placeholder="价格">
            </div>
            <h5>是否显示价格</h5>
            <div class="mui-input-row" style="margin: 10px 5px;">
                <span></span>
                <div class="mui-switch mui-active">
                    <div class="mui-switch-handle"></div>
                </div>
            </div>
            <h5>可购买最大数量</h5>
            <div class="mui-input-row" style="margin: 10px 5px;">
                <input id="PurchaseQuantity" name="PurchaseQuantity" type="text" class="mui-input-clear" placeholder="可购买最大数量">
            </div>
            <h5>可购买最小数量</h5>
            <div class="mui-input-row" style="margin: 10px 5px;">
                <input type="text" class="mui-input-clear" placeholder="可购买最小数量">
            </div>
            @*<h5>商品轮播图</h5>
            <div class="mui-input-row" style="margin: 10px 5px;">
                <div class="file" id="image-1"></div>
            </div>*@
            @*<h5>商品介绍图</h5>
            <div class="mui-input-row" style="margin: 10px 5px;">
                <textarea id="textarea" rows="10" placeholder="商品介绍"></textarea>
            </div>*@
            <h5>商品介绍</h5>
            <div class="mui-input-row" style="margin: 10px 5px;">
                <textarea id="Content" name="Content" rows="10" placeholder="商品介绍"></textarea>
            </div>
            <div class="mui-button-row">
                <button type="button" class="mui-btn mui-btn-primary" onclick="return false;">确认</button>&nbsp;&nbsp;
                <button type="button" class="mui-btn mui-btn-danger" onclick="return false;">取消</button>
            </div>
        </div>


        @*<div class="mui-content-padded">
            <div class="mui-inline">问题和意见</div>
        </div>
        <div class="row mui-input-row">
            <textarea id='question' class="mui-input-clear question" placeholder="请详细描述你的问题和意见..."></textarea>
        </div>
        <p>图片(选填,提供问题照片,总大小10M以下)</p>
        <div id='image-list' class="row image-list">

        </div>

        <p></p>
        <div class="mui-input-row">
            <input id='contact' type="text" class="mui-input-clear contact" placeholder="(QQ/邮箱/固定电话/移动电话 ,方便我们联系你 )" />
            <input type="text" id="Address" class="mui-input-clear contact" placeholder="详情地址" />
        </div>
        <br />*@
    </div>
</div>
<script src="/js/min.NewView.js"></script>
<script src="/js/feedback-page.js"></script>
<script>
    mui.init();
    //初始化单页view
    var viewApi = mui('#app').view({
        defaultPage: '#feedback'
    });
    //处理view的后退与webview后退
    (function ($) {
        mui('.mui-content .mui-switch').each(function () { //循环所有toggle
            //toggle.classList.contains('mui-active') 可识别该toggle的开关状态
            this.parentNode.querySelector('span').innerText = '状态：' + (this.classList.contains('mui-active') ? 'true' : 'false');
            /**
             * toggle 事件监听
             */
            this.addEventListener('toggle', function (event) {
                //event.detail.isActive 可直接获取当前状态
                this.parentNode.querySelector('span').innerText = '状态：' + (event.detail.isActive ? 'true' : 'false');
            });
        });
    })(mui);
</script>
